package com.estun.backroundManagementService.utils;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;

/**
 * @author yusiocng
 * @date 2024/1/17
 * @description 时间工具类
 */
public class DateTimeUtils {
    public static long localDateTimeToTimestamp(LocalDateTime localDateTime) {
        // 转换为 Instant，使用默认时区
        Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant();
        // 获取 13 位时间戳
        return instant.toEpochMilli();
    }
}
